package com.supplychainapi.common.exception;

import com.supplychainapi.common.RestResponse;

public class ExceptionManager {

    public static CustomException fail(RestResponse restResponse) {
        return new CustomException(restResponse);
    }

    public static CustomException fail(int code, int errorCode, String message) {
        return new CustomException(RestResponse.fail(code, errorCode, message));
    }

    public static CustomException fail(int code, String message) {
        return new CustomException(RestResponse.fail(code, -1, message));
    }

    public static CustomException fail(String message) {
        return new CustomException(RestResponse.fail(400, -1, message));
    }
}